package com.fitness.controller;

import com.fitness.entity.PostEntity;
import com.fitness.service.PostService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "post")
public class PostController {
    @Resource
    private PostService postService;

    @GetMapping(value = "{id}")
    public List<PostEntity> list(@PathVariable Long id) {

        return postService.list(id);
    }
}
